 <meta charset="utf-8">
 <div class="box" id="biz_salaryPercentage_conatainer">
            <div class="box-header with-border">
               <form id="searchForm" role="form" class="form-inline">
                   <div class="form-group">
	                  <label for="name">授薪人员姓名</label>
	                  <input type="text"  readonly="readonly" v-on:click="chooseSalariedstaff" v-model="searchForm.salariedstaffName"  name="salariedstaffName" class="form-control" id="salariedstaffName" placeholder="点击选择" required>
	                </div> 
	                
                    <div class="form-group">
                         <label>当事人</label>
                         <input name="name" v-model="searchForm.clientName"   type="text" placeholder="" class="form-control">
                    </div>
                    
                      <div class="form-group">
                         <label>案号</label>
                         <input name="name" v-model="searchForm.caseNum"   type="text" placeholder="" class="form-control">
                    </div>
                     <div class="form-group">
		                <label for="startTime">开始时间</label>
		                 <input type="text"  v-kmdate="{vmodel:'searchForm.startTime',format:'yyyy-MM-dd'}"  class="form-control"  v-model="searchForm.startTime">
		            </div>
	             <div class="form-group">
	                <label for="enfTime">截止时间</label>
	                 <input type="text"  v-kmdate="{vmodel:'searchForm.endTime',format:'yyyy-MM-dd'}"  class="form-control"  v-model="searchForm.endTime">
	            </div>
                    <button type="button"  class="btn btn-info pull-right m-t-n-xs" v-kperms="{perm:'authRole:loadAuthRoleList'}"  v-on:click="search();"><strong>查询</strong></button>
                </form>
            </div>
 <div class="box-body">
 	                           <div class="btn-group " id="salaryPercentageBTableToolbar" role="group">
 	                           		<button type="button" v-kperms="{perm:'authRole:addRole'}"  class="btn btn-default" v-on:click="add">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 添加
                                    </button>
                                     <button type="button"  v-kperms="{perm:'authRole:updateRole'}" class="btn btn-default" v-on:click="edit">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i> 修改
                                    </button>
                                       <button type="button"  v-kperms="{perm:'authRole:deletAuthRole'}" class="btn btn-default" v-on:click="deletex">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i> 删除
                                    </button>
                           </div>
                                
           <table id="salaryPercentageBTable" data-mobile-responsive="true" ></table>
 </div>
 </div>

<script> 
new Vue({  
	  el: '#biz_salaryPercentage_conatainer',  
	  data:{
		  searchForm:{
			salariedstaffName: null,
      		salariedstaff: null,
      		caseNum: null,
      		startTime: null,
      		endTime: null
		  },
		  bus:new Vue(),
	  },
	  mounted:function(){
		 let _this=this;
		 _this.initTable();
	  },
  methods: {
	  initTable:function(){
		  let columns=[
				{checkbox:true},
				{field:'salariedstaffName',title:'授薪人员',width:100,sortable:true},
				{field:'caseNum',title:'案号',width:100,sortable:true},
				{field:'amount',title:'金额',width:100,sortable:true},
				{field:'createTime',title:'时间',width:100,sortable:true},
				{field:'clientName',title:'当事人',width:100},
				{field:'clientPhone',title:'当事人电话',width:100},
				{field:'fromPractitionerName',title:'转入律师',width:100},
				{field:'progressName',title:'进展程度',width:100}];
		  let url="tcms/salaryPercentage/loadSalaryPercentageDataSet";
  		zfesBstable.vueLoadTable($("#salaryPercentageBTable"),$("#salaryPercentageBTableToolbar"),url,columns,this.searchForm);
	  },
	  search:function(){
		  zfesBstable.reload($("#salaryPercentageBTable")); 
	  },
	  refresh:function(){
		  zfesBstable.refresh($("#salaryPercentageBTable"));
	  },
	  	chooseSalariedstaff: function(){
	  		let _this=this;
	    	let url="/view/tcms/salariedstaff/salariedstaff.lookback.html";
	    	let param={}
	    	zfesLayerEditDg.lookback(url, param, "选择授薪人员", 600, function() {
	    		 let data =zfesLayerEditDg.getCallBackParam();
	    		 _this.searchForm.salariedstaffName=data.name;
	    		 _this.searchForm.salariedstaff=data.id;
	    	})
	  	  },
	  add:function(){
		  let　_this=this;
		 var url="/view/tcms/salaryPercentage/salaryPercentage.add.html";
		 zfesLayerEditDg.open(url,{},"授薪人员提成信息编辑",460,function(){_this.refresh();});
		 
	  },
	  
	  edit:function(){
		  if(zfesBstable.isOneRow($("#salaryPercentageBTable"))){
			  let　_this=this;
			  let id=zfesBstable.getRowId($("#salaryPercentageBTable"));
			  var url="/view/tcms/salaryPercentage/salaryPercentage.edit.html";
			  zfesLayerEditDg.open(url,{"id":id},"授薪人员提成信息编辑",460,function(){_this.refresh();}); 
		 }
	  },
	  deletex:function(){
			if(zfesBstable.isOneRow($("#salaryPercentageBTable"))){
				  let　_this=this;
					var id=zfesBstable.getRowId($("#salaryPercentageBTable"));
					 alertSwal.confirm("删除","是否执行该操作",function(){
						    let ajaxUrl = "tcms/salaryPercentage/deletSalaryPercentage";
							zfesAjax.ajaxTodo(ajaxUrl, { "id" : id}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
							},function(data){
								
							}); 
				});
			}
				
	  }
 }

});
</script>


